<?php
/**
 * Created by JetBrains PhpStorm.
 * User: ishowshao
 * Date: 12-12-11
 * Time: 上午12:32
 * To change this template use File | Settings | File Templates.
 */
require 'config.php';
session_set_cookie_params(3600 * 24);
session_start();
$output = array(
    'success' => false,
);
if (isset($_POST['password'])) {
    if (array_key_exists($_POST['password'], $GLOBALS['users'])) {
        $_SESSION['username'] = $GLOBALS['users'][$_POST['password']];
        $output['success'] = true;
    }
}
echo json_encode($output);
